Skip to content

fix: Timezone-Agnostic Daily Streak Calculation (#191)#198

Open
nitishchaubeyy wants to merge 14 commits into
indresh404:mainfrom
nitishchaubeyy:fix/timezone-agnostic-streaks
Open

fix: Timezone-Agnostic Daily Streak Calculation (#191)#198
nitishchaubeyy wants to merge 14 commits into
indresh404:mainfrom
nitishchaubeyy:fix/timezone-agnostic-streaks

Conversation

@nitishchaubeyy
Copy link
Copy Markdown
Contributor

Description

Resolves #191 by anchoring the Daily Activity Streak evaluation logic exclusively to standardized UTC dates, preventing local system timezones from corrupting streak continuations or permitting double-dipping.

Key Changes:

  • String-Based Boundaries: Shifted date comparison logic from raw new Date() milliseconds to explicit YYYY-MM-DD ISO strings representing the strict UTC boundary.
  • Math Refactoring: Replaced sequential timestamp math with discrete Date.UTC() calculations to accurately check if the time difference is exactly 1 day (diffDays === 1).
  • Points Synchronization: Streak increments now safely increment streakPoints and totalPoints using proper database mutation standards during the login handshake.
  • Restored Batch Integrity: Maintained the previously integrated writeBatch infrastructure inside syncGitHubData (Issue [Feature][Level 3] Atomic Batch Writes for Profile Sync to Prevent Data Fragmentation #193) to ensure full file compatibility.

Fixes #191

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ranker-hub Error Error Jun 6, 2026 10:45am

@github-actions github-actions Bot added backend Backend/Firebase related changes bug Something isn't working enhancement New feature or request gssoc GirlScript Summer of Code gssoc26 GirlScript Summer of Code 2026 nsoc NSoC NSoC'26 NSoC 2026 pending-review PR is pending review labels Jun 3, 2026
@indresh404
Copy link
Copy Markdown
Owner

merge conflict

@nitishchaubeyy
Copy link
Copy Markdown
Contributor Author

Done @indresh404

@indresh404
Copy link
Copy Markdown
Owner

Solve Merge Conflict

1 similar comment
@indresh404
Copy link
Copy Markdown
Owner

Solve Merge Conflict

@nitishchaubeyy
Copy link
Copy Markdown
Contributor Author

Done @indresh404

@indresh404
Copy link
Copy Markdown
Owner

CI Checks / Lint Check test should pass

@nitishchaubeyy
Copy link
Copy Markdown
Contributor Author

Completed @indresh404

@indresh404
Copy link
Copy Markdown
Owner

Solve Merge Conflict

@nitishchaubeyy
Copy link
Copy Markdown
Contributor Author

Done @indresh404

@indresh404
Copy link
Copy Markdown
Owner

If your PR still shows the old failed Vercel check, please rebase (or merge the latest main branch into your branch) and push again to trigger a fresh deployment/check run.

# Conflicts:
#	src/pages/RankHer.jsx
…tishchaubeyy/RankerHub into fix/timezone-agnostic-streaks

# Conflicts:
#	src/pages/RankHer.jsx
@nitishchaubeyy
Copy link
Copy Markdown
Contributor Author

Hey @indresh404, I synced the branch with the latest main and pushed again to trigger the deployment. I also ran npm run build and npm run lint locally, and everything compiles perfectly without any errors on my end.

Since I don't have access to the Vercel logs, could you please check if it's failing due to a missing Environment Variable or a caching issue on Vercel's end? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend/Firebase related changes bug Something isn't working enhancement New feature or request gssoc GirlScript Summer of Code gssoc26 GirlScript Summer of Code 2026 level:advanced level3 nsoc NSoC NSoC'26 NSoC 2026 pending-review PR is pending review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Level 3] Timezone-Agnostic Daily Streak Calculation

2 participants